// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------

// CS1591 - Missing XML comment for publicly visible type or member 'Type_or_Member' is disabled in this file because it does not ship anymore.
#pragma warning disable 1591

namespace System.Fabric.Testability.Client.Requests
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Threading;
    using System.Threading.Tasks;

    public class GetEventsStorePartitionEventsRequest : GetEventsStoreEventsRequest
    {
        public GetEventsStorePartitionEventsRequest(
            IFabricClient fabricClient,
            Guid partitionId,
            DateTime startTimeUtc,
            DateTime endTimeUtc,
            IList<string> eventsTypesFilter,
            bool excludeAnalysisEvents,
            bool skipCorrelationLookup,
            TimeSpan timeout)
            : base(fabricClient, startTimeUtc, endTimeUtc, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup,  timeout)
        {
            this.PartitionId = partitionId;
        }

        public Guid PartitionId { get; private set; }

        public override string ToString()
        {
            return string.Format(
                CultureInfo.InvariantCulture,
                "{0}, PartitionId={1}",
                base.ToString(),
                this.PartitionId);
        }

        public override async Task PerformCoreAsync(CancellationToken cancellationToken)
        {
            this.OperationResult = await this.FabricClient.GetEventsStorePartitionEventsRestAsync(
                this.PartitionId,
                this.StartTimeUtc,
                this.EndTimeUtc,
                base.EventsTypesFilter,
                base.ExcludeAnalysisEvents,
                base.SkipCorrelationLookup).ConfigureAwait(false);
        }
    }
}

#pragma warning restore 1591